package com.masterclient.app.businessmodule.usermodule.api;

import com.eoner.baselib.container.CommonBaseResponse;
import com.eoner.common.bean.base.CommonBaseBean;
import com.eoner.managerlibrary.netsign.core.FCRetrofitManager;
import com.masterclient.app.businessmodule.usermodule.login.beans.AuthBindNewBean;
import com.masterclient.app.businessmodule.usermodule.login.beans.CaptchaBean;
import com.masterclient.app.businessmodule.usermodule.login.beans.InviteInfoBean;
import com.masterclient.app.businessmodule.usermodule.login.beans.LoginBgBean;
import com.masterclient.app.businessmodule.usermodule.login.beans.LoginResultBean;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;

/**
 * 文件名：UserApi
 * 描 述：只处理登录相关的v1接口实现调用方法
 * 作 者：gyq
 * 时 间：2021-2-22
 */
public class UserHttpService {

    private static UserApi api;
    private static UserHttpService instance;
    public static UserHttpService getInstance() {
        synchronized (UserHttpService.class){
            if(instance == null){
                instance = new UserHttpService();
            }
        }
        return instance;
    }

    private UserHttpService() {
        api = FCRetrofitManager.getInstance().getRetrofit().create(UserApi.class);
    }

    /**
     * 用户绑定手机号
     * */
    public io.reactivex.Observable<AuthBindNewBean> authBind(@Body RequestBody body) {
        return api.authBind(body);
    }

    /**
     * 获取验证码
     * */
    public io.reactivex.Observable<CaptchaBean> getCaptcha(@Body RequestBody body) {
        return api.getCaptcha(body);
    }

    /**
     * 获取邀请人信息
     * */
    public io.reactivex.Observable<InviteInfoBean> getInviteInfo(@Body RequestBody body) {
        return api.getInviteInfo(body);
    }

    /**
     * 微信登录绑定手机号短信校验接口
     * */
    public io.reactivex.Observable<LoginResultBean> thirdCheckCaptcha(@Body RequestBody body) {
        return api.thirdCheckCaptcha(body);
    }

    /**
     * 找回密码
     * */
    public io.reactivex.Observable<LoginResultBean> forgotSetPwd(@Body RequestBody body) {
        return api.forgotSetPwd(body);
    }

    /**
     * 第三方授权登录
     * */
    public io.reactivex.Observable<LoginResultBean> authLogin(@Body RequestBody body) {
        return api.authLogin(body);
    }

    /**
     * 获取广告信息
     */
    public Observable<CommonBaseResponse<LoginBgBean>> getAdInfo(String adLabel) {
        return api.getAdInfo(adLabel);
    }

    /**
    * 密码登录
    * */
    public io.reactivex.Observable<LoginResultBean> pwdLogin(@Body RequestBody body) {
        return api.pwdLogin(body);
    }

    /**
     * 验证码登录
     * */
    public io.reactivex.Observable<LoginResultBean> quickLogin(@Body RequestBody body) {
        return api.quickLogin(body);
    }

    /**
    * 验证码校验
    * */
    public io.reactivex.Observable<CommonBaseBean> checkCaptcha(@Body RequestBody body) {
        return api.checkCaptcha(body);
    }

}
